package net.qhzw.geologr5.gis.service.system;

import com.alibaba.fastjson.JSON;
import net.qhzw.geologr5.gis.common.framework.utils.StringUtils;
import net.qhzw.geologr5.gis.service.system.controller.ProjectPointType;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

public class StringUtil {




    @Test
    public void testr(){


//        String timeStr = TimeSimpleUtil.getTimeStr();
//        String randomString = UUIDUtil.getRandomString(6);
//        System.out.println(timeStr);
//        System.out.println(randomString);

        //String unZipDir = "/opt/upload/unZipDir/" + TimeSimpleUtil.getTimeStr() + "/" + UUIDUtil.getRandomString(6) + "/";


       // System.out.println(unZipDir);


    }

    @Test
    public void test2O(){
        Map<String, String> map = new HashMap<>();
        map.put("探槽编号", "001");
        map.put("探槽素描", "abc");
        String string = JSON.toJSONString(map);
        System.out.println(string);

    }



    @Test
    public void test4(){
        String str = "1.jpeg";
        if (str.endsWith(".jpeg")){
            System.out.println("ok");
        }else {
            System.out.println("on");
        }
    }

    @Test
    public void testarr(){
        Integer[] arr = new Integer[]{1,2,3};
        System.out.println(arr.length);

    }


    @Test
    public String testCon(){
        String str = "http://122.114.14.42:8089/group1/M00/00/01/enIOKmDmplGAcCUKAAkpCD8L8gA76.jpeg";
        String[] split = str.split("/");
        StringBuffer sb = new StringBuffer();
        for (int i = 3; i < split.length; i++) {
            String s = split[i];
            System.out.println(s);
            if (split.length - 1  == i){
                sb.append(s);
            }else {
                sb.append(s).append("/");
            }
        }
        return sb.toString();
    }


    @Test
    public void test(){
        Stu stu = new Stu();
        stu.setId(1);
        if (!StringUtils.isNull(stu)){
            System.out.println("空的");
        }
    }


    @Test
    public void test2(){
        ProjectPointType type = new ProjectPointType();
        type.setId(1);
        type.setPid(1);
        if (type.getId().equals(type.getPid())){
            System.out.println("===================");
        }


    }

}
